package com.shrcl.engineerprocess.domain.impl;

import com.shrcl.engineerprocess.domain.WorkSummary;
import com.shrcl.engineerprocess.domain.proxy.WorkSummaryProxy;
import edu.fudan.mylang.pf.BaseModelObject;
import edu.fudan.mylang.pf.IObjectFactory;
import java.util.Date;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.hibernate.annotations.DiscriminatorOptions;

@Entity
@DiscriminatorValue("WORKSUMMARY_TYPE")
@DiscriminatorOptions(force = true)
@DiscriminatorColumn(length = 64)
@Table(name = "worksummary")
public class WorkSummaryImpl extends BaseModelObject implements WorkSummary {
  public WorkSummaryImpl() {
    super();
  }
  
  private Date date;
  
  public Date getDate() {
    return this.date;
  }
  
  public WorkSummary setDate(final Date date) {
    this.date = date;
    return this;			
    
  }
  
  private String summary;
  
  public String getSummary() {
    return this.summary;
  }
  
  public WorkSummary setSummary(final String summary) {
    this.summary = summary;
    return this;			
    
  }
  
  public static WorkSummary create(final IObjectFactory objectFactory) {
    com.shrcl.engineerprocess.domain.WorkSummary workSummary = new com.shrcl.engineerprocess.domain.impl.WorkSummaryImpl(
    );
    objectFactory.create(workSummary);
    return workSummary;			
    
  }
  
  public static WorkSummary createWorkSummaryImpl(final IObjectFactory objectFactory, final Procedure1<WorkSummary> init) {
    com.shrcl.engineerprocess.domain.WorkSummary workSummary = new com.shrcl.engineerprocess.domain.impl.WorkSummaryImpl(
    );
    objectFactory.create(workSummary);
    init.apply(workSummary);
    
    return workSummary;			
    
  }
  
  public WorkSummaryProxy toProxy() {
    com.shrcl.engineerprocess.domain.proxy.WorkSummaryProxy proxy = new com.shrcl.engineerprocess.domain.proxy.WorkSummaryProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
